package util;

import java.awt.image.BufferedImage;

public class Util {

    public static BufferedImage getBufferedImage(int[] a, int width, int height) {
        BufferedImage buf = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
        for (int i = 0; i < height; i++) {
            for (int j = 0; j < width; j++) {
                buf.setRGB(j, i, a[i * width + j]);
            }
        }
        return buf;
    }
}
